function Dog(name, age) {
    this.name = name;
    this.age = age;
}

Dog.prototype.bark = function() {
    console.log(`我叫${this.name},今年${this.age}岁了，汪汪汪！`);
}

let _new = function(fn, ...params) {
    const obj = {}
    fn.apply(obj, params)
    obj.__proto__ = fn.prototype
    return obj
}

let dog = _new(Dog, '旺财', 3)
dog.bark()